// -----------------------------------------------------------------------
// <copyright file="CacheManager.cs" company="SoftServe">
// CacheManager for WebServer
// </copyright>
// -----------------------------------------------------------------------
namespace WebServer.BusinessLogic.Web.Cache
{
    using WebServer.BusinessLogic.Helpers;

    /// <summary>
    /// Class for Managing Cache
    /// </summary>
    public class CacheManager
    {
        /// <summary>
        /// Object of class CacheManagerInstance
        /// </summary>
        private static CacheManagerInstance instance;

        /// <summary>
        /// Sync Root object
        /// </summary>
        private static object syncRoot = new object();

        /// <summary>
        /// Gets CacheManagerInstance
        /// </summary>
        public static CacheManagerInstance Instance
        {
            get
            {
                if (instance == null)
                {
                    lock (syncRoot)
                    {
                        if (instance == null)
                        {
                            instance = new CacheManagerInstance();
                        }
                    }
                }

                return instance;
            }
        }
    }
}